package com.mew.lobby.handler.invite;


import com.mew.common.rest.bo.MewSession;
import com.mew.common.rest.invite.InviteUserResponseMessage;
import com.mew.lobby.annotation.LobbyHandler;
import com.mew.lobby.net.LobbyHandlerMapCmdType;
import com.mew.lobby.net.MewHandler;
import com.mew.lobby.provide.InviteFeignService;
import com.zebra.remoting.config.EmptyMessage;
import com.zebra.remoting.protocol.ZebraCommand;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 推荐人  查询推荐列表
 * @author dylin
 * @create 2021/3/31
 */
@Service
@Slf4j
@LobbyHandler(LobbyHandlerMapCmdType.InviterList)
public class InviteUserListHandler implements MewHandler<EmptyMessage> {
    @Autowired
    private InviteFeignService inviteFeignService;

    @Override
    public void handle(ZebraCommand<EmptyMessage> zebraCommand, MewSession session) {
        InviteUserResponseMessage message = inviteFeignService.getInviteUserList(zebraCommand.getUserId());
        zebraCommand.sendMessage(message);
    }
}
